<{include file ="header.tpl"}>
<{include file ="navibar.tpl"}>
<{include file ="sidebar.tpl"}>
<!-- START 以上内容不需更改，保证该TPL页内的标签匹配即可 -->
<{$osadmin_action_alert}>
<{$osadmin_quick_note}>

<form class="form_search" action="" method="GET" style="margin-bottom:0px">
    <div style="float:left;margin-right:5px">
        <label> 选择起始时间 </label>
        <input type="text" id="start_date" name="start_date" value="<{$_GET.start_date}>" placeholder="起始时间"
               required="true">
    </div>
    <div style="float:left;margin-right:5px">
        <label>选择结束时间</label>
        <input type="text" id="end_date" name="end_date" value="<{$_GET.end_date}>" placeholder="结束时间" required="true">
    </div>
    <div style="float:left;margin-right:5px">
        <label>查询所有用户请留空</label>
        <input type="text" name="user_name" value="<{$_GET.user_name}>" placeholder="输入购买用户名">
        <input type="text" name="phone" value="<{$_GET.phone}>" placeholder="输入购买用户手机号">
        <input type="hidden" name="search" value="1">
    </div>
    <div class="btn-toolbar" style="padding-top:25px;padding-bottom:0px;margin-bottom:0px">
        <button type="submit" class="btn btn-primary">查询</button>
    </div>
    <div style="clear:both;"></div>
</form>

<form class="form_search" action="order_search_dn.php" method="GET" style="margin-bottom:0px">
    <div style="float:left;margin-right:5px">
        <label> 选择起始时间 </label>
        <input type="text" id="start_date1" name="start_date" value="<{$_GET.start_date}>" placeholder="起始时间"
               required="true">
    </div>
    <div style="float:left;margin-right:5px">
        <label>选择结束时间</label>
        <input type="text" id="end_date1" name="end_date" value="<{$_GET.end_date}>" placeholder="结束时间" required="true">
    </div>
    <div style="float:left;margin-right:5px">
        <label>查询所有用户请留空</label>
        <input type="text" name="user_name" value="<{$_GET.user_name}>" placeholder="输入购买用户名">
        <input type="text" name="phone" value="<{$_GET.phone}>" placeholder="输入购买用户手机号">
        <input type="hidden" name="dn" value="1">
    </div>
    <div class="btn-toolbar" style="padding-top:25px;padding-bottom:0px;margin-bottom:0px">
        <button type="submit" class="btn btn-primary">下载数据表</button>
    </div>
    <div style="clear:both;"></div>
</form>

<div class="block">
    <a href="#page-stats" class="block-heading" data-toggle="collapse">订单查询列表</a>

    <{if !empty($orders)}>
    <div id="page-stats" class="block-body collapse in">
        <table class="table table-striped">
            <thead>
            <tr style="background:#fff;color:#000;font-size: 14px;font-weight: normal;">
                <th style="background:#fff;color:#000;font-size: 14px;font-weight: normal;">订单号</th>
                <th style="background:#fff;color:#000;font-size: 14px;font-weight: normal;">用户名称</th>
                <th style="background:#fff;color:#000;font-size: 14px;font-weight: normal;">手机号</th>
                <th style="background:#fff;color:#000;font-size: 14px;font-weight: normal;">送货地址</th>
                <th style="background:#fff;color:#000;font-size: 14px;font-weight: normal;">留言备注</th>
                <th style="background:#fff;color:#000;font-size: 14px;font-weight: normal;">下单时间</th>
                <th style="background:#fff;color:#000;font-size: 14px;font-weight: normal;" rowspan="6">购买商品信息</th>
                <th style="background:#fff;color:#000;font-size: 14px;font-weight: normal;">付款方式</th>
                <th style="background:#fff;color:#000;font-size: 14px;font-weight: normal;">付款信息</th>
                <th style="background:#fff;color:#000;font-size: 14px;font-weight: normal;">订单状态</th>
                <th style="background:#fff;color:#000;font-size: 14px;font-weight: normal;">快递名称</th>
                <th style="background:#fff;color:#000;font-size: 14px;font-weight: normal;">当前快递状态</th>

            </tr>
            </thead>
            <tbody>
            <{foreach name=order from=$orders item=order_info}>
                <tr style="background:#fff;">
                    <td style="background:#fff;color:#000;font-size: 14px;font-weight: normal;">
                        <{$order_info.website}>
                    </td>
                    <td style="background:#fff;color:#000;font-size: 14px;font-weight: normal;">
                        <{$order_info.order_sn}>
                    </td>
                    <td style="background:#fff;color:#000;font-size: 14px;font-weight: normal;">
                        <{$order_info.user_name}>
                    </td>
                    <td style="background:#fff;color:#000;font-size: 14px;font-weight: normal;">
                        <{$order_info.phone}>
                    </td>
                    <td style="background:#fff;color:#000;font-size: 14px;font-weight: normal;">
                        <{$order_info.addres}>
                    </td>
                    <td style="background:#fff;color:#000;font-size: 14px;font-weight: normal;">
                        <{$order_info.note}>
                    </td>
                    <td style="background:#fff;color:#000;font-size: 14px;font-weight: normal;">
                        <{$order_info.createtime}>
                    </td>

                    <td style="background:#fff;color:#000;font-size: 14px;font-weight: normal;">

                        <table class="table table-striped">
                            <thead>
                            <tr style="background:#fff;color:#000;font-size: 14px;font-weight: normal;">
                                <th style="background:#fff;color:#000;font-size: 14px;font-weight: normal;">商品名称</th>
                                <th style="background:#fff;color:#000;font-size: 14px;font-weight: normal;">商品型号</th>
                                <th style="background:#fff;color:#000;font-size: 14px;font-weight: normal;">数量</th>
                                <th style="background:#fff;color:#000;font-size: 14px;font-weight: normal;">总价</th>
                                <th style="background:#fff;color:#000;font-size: 14px;font-weight: normal;">颜色</th>
                                <th style="background:#fff;color:#000;font-size: 14px;font-weight: normal;">尺寸</th>
                            </tr>
                            </thead>

                            <tbody>
                            <{foreach name=prodinfo from=$order_info.prod_infos item=prod_info}>
                                <tr style="background:#fff;">
                                    <td style="background:#fff;color:#000;font-size: 14px;font-weight: normal;">
                                        <{$prod_info.products_name}>
                                    </td>
                                    <td style="background:#fff;color:#000;font-size: 14px;font-weight: normal;">
                                        <{$prod_info.products_model}>
                                    </td>
                                    <td style="background:#fff;color:#000;font-size: 14px;font-weight: normal;">
                                        <{$prod_info.num}>
                                    </td>
                                    <td style="background:#fff;color:#000;font-size: 14px;font-weight: normal;">
                                        <{$prod_info.total_price}>
                                    </td>
                                    <td style="background:#fff;color:#000;font-size: 14px;font-weight: normal;">
                                        <{$prod_info.products_color}>
                                    </td>
                                    <td style="background:#fff;color:#000;font-size: 14px;font-weight: normal;">
                                        <{$prod_info.products_size}>
                                    </td>
                                </tr>

                                <{/foreach}>
                            </tbody>
                        </table>
                    </td>

                    <td style="background:#fff;color:red;font-size: 14px;font-weight: normal;">
                        <{$order_info.pay_type}>
                    </td>
                    <td style="background:#fff;color:red;font-size: 14px;font-weight: normal;">
                        <{$order_info.pay_info}>
                    </td>
                    <{if $order_info.sadOrder == '1'}>
                    <td style="background:#fff;color:red;font-size: 14px;font-weight: normal;">
                        疑似恶意订单
                    </td>
                    <{else}>
                    <td style="background:#fff;color:green;font-size: 14px;font-weight: normal;">
                        正常订单
                    </td>
                    <{/if}>

                    <td style="background:#fff;color:#000;font-size: 14px;font-weight: normal;">
                        <{$order_info.kd_name}>
                    </td>
                    <{if $order_info.kd_status == '已发货'}>
                    <td style="background:#fff;color:blue;font-size: 14px;font-weight: normal;">
                        <{$order_info.kd_status}>
                    </td>
                    <{else}>
                    <td style="background:#fff;color:red;font-size: 14px;font-weight: normal;">
                        <{$order_info.kd_status}>
                    </td>
                    <{/if}>
                </tr>
                <{/foreach}>

            </tbody>
        </table>
        <{$page_html}>
    </div>
    <{/if}>
</div>


<script>
    $(function () {
        var date = $("#start_date");
        date.datepicker({dateFormat: "yy-mm-dd"});
        date.datepicker("option", "firstDay", 1);

        var date1 = $("#start_date1");
        date1.datepicker({dateFormat: "yy-mm-dd"});
        date1.datepicker("option", "firstDay", 1);
    });
    $(function () {
        var date = $("#end_date");
        date.datepicker({dateFormat: "yy-mm-dd"});
        date.datepicker("option", "firstDay", 1);

        var date1 = $("#end_date1");
        date1.datepicker({dateFormat: "yy-mm-dd"});
        date1.datepicker("option", "firstDay", 1);
    });
</script>

<{$osadmin_action_confirm}>
<!-- END 以下内容不需更改，请保证该TPL页内的标签匹配即可 -->
<{include file="footer.tpl" }>